#pragma once

#include "resource.h"
#include "Dx11app.h"
#include "Vector4.h"
#include "Vector2.h"


namespace FIRSTDX
{
	struct vertex
	{
		vec3f pos;
		vec3f normal;
		vec4f color;
		vec2f coord;
		vertex(vec3f _pos, vec3f _normal,vec4f _color, vec2f _coord)
			:pos(_pos),normal(_normal),color(_color),coord(_coord)
		{}
	};

	class Dx11Test:public Dx11app
	{
	public:
		Dx11Test(HINSTANCE hInstance, int nCmdShow):
		 Dx11app(hInstance, nCmdShow), m_squareVBO(nullptr),m_squareIBO(nullptr)
		 {}
		~Dx11Test();
		void initialize();
		void updateFrame();
		void setupIBO();
		void setuoVBO();

		void drawOrigin(float len);

		void createSquareVI();
		void reCreateBuffer();
	private:
		ID3D11Buffer* m_ibuff;
		ID3D11Buffer* m_vbuff;
 
		vector<vertex> m_vertexVec;
		
		ID3D11ShaderResourceView* m_texture;

 
		//Camera
		Camera m_camera;


		ID3D11Buffer* m_squareVBO;
		ID3D11Buffer* m_squareIBO;

		vector<vertex> m_squareVertexVec;
		vector<unsigned int> m_squareIndexVec;

	};
}
